package com.itcast.mallapplet.mapper;

import com.itcast.applet.dto.RiderAmendDTO;
import com.itcast.applet.entity.Order;
import com.itcast.applet.entity.Rider;
import com.itcast.applet.entity.RiderTask;
import com.itcast.applet.vo.RiderTaskVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RiderMapper {

    //查询单个骑手信息
    @Select("select id, name, account, password, phone, avatar, sex, lat, ing, status from rider where id = #{id}")
    Rider getById(Long id);

    //根据账号查询骑手
    @Select("select id, name, account, password, phone, avatar, sex, lat, ing, status  from rider where account = #{account} and password = #{password}")
    Rider getByAaccount(String account,String password);

    //骑手 - 查骑手任务表 . order - order订单表    可一条sql查
    RiderTaskVO[] getByOrder(Long id);

    //骑手经纬度修改
    void riderAmendIng(RiderAmendDTO riderAmendDTO);

    //骑手状态修改
    void riderStatus(Long riderId);
}
